'use strict';
app.service('userCouponsGiveService',['$http','$q','utilService',function($http,$q,utilService){
    this.couponsGive = function($scope){
        var deferred = $q.defer();
        utilService.api({
            url:$scope.app.domain + 'all/coupons/add',
            data:$scope.param,
            method:'POST'
        }).then(function(result){
            deferred.resolve(result);
        });
        return deferred.promise;
    }

    this.delCoupons = function($scope){
        var deferred = $q.defer();
        utilService.api({
            url:$scope.app.domain + 'all/coupons/del',
            data:{couponsId:$scope.param.couponsId},
            method:'PUT'
        }).then(function(result){
            deferred.resolve(result);
        });
        return deferred.promise;
    }
}]);

